package com.design.create.prototype;

public class PrototypeTest {

    public static void main(String[] args) {
        //浅拷贝
        ShallowClonePrototype shallowClonePrototype = new ShallowClonePrototype();
        Prototype clone = shallowClonePrototype.clone();
        clone.show();
        System.out.println(clone.list == shallowClonePrototype.list);

        //深拷贝
        DeepClonePrototype deepClonePrototype = new DeepClonePrototype();
        Prototype clone1 = deepClonePrototype.clone();
        clone1.show();
        System.out.println(clone1.list == deepClonePrototype.list);
    }
}
